<?php
#  Gfanqiang - Software suite for breakthrough GFW
#
#  by Hong Kong Network Institute of Liberty(NIL), licensed under The GNU General Public License v3.0
#  You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
#  
#  miscellaneous.php - Last cleanup
#  Without full SVN Client support, we can only do delete,move,rename operation by this way......

/* No Chrome Support anymore
   We suggest you to create your own "gfangqiang-chrome.bat" script and "startchrome.inc.bat"
   with Chrome Portable - http://portableapps.com/apps/internet/google_chrome_portable
   
   Or You may interest in WoW-Browser Project - http://kirito.duapp.com/ */
@unlink("gfanqiang-chrome.bat");

/* Remove NSI Installer support due to cleanup problem issue */
@unlink("makensi.php");

/* 20121207 Remove incorrect Pinyin Filename
   I am Gfanqiang not Gfangqiang, OK? */
@unlink("gfangqiang-debug.bat");
@unlink("gfangqiang-donotupdate.bat");
@unlink("gfangqiang-donotupdate-debug.bat");
@unlink("gfangqiang-standalone.bat");

/* 20121218 Remove proxy.custom
   You may edit the FindProxyForURL() section in /goagent-local/proxy.pac to create custom rules */
if(file_exists('data/proxy.custom')){
	@unlink('data/proxy.custom');
}

/* 20130208 Create Flag Directory for futher use */
if(! is_dir("data/flag")){
	mkdir("data/flag");
}

/* START FUNCTION */
function is_flag($seq){
	if(!file_exists("data/flag/{$seq}.flag")){
		return false;
	}else{
		return true;
	}
}

function set_flag($seq){
	touch("data/flag/{$seq}.flag");
}

function _unlink($target){
	echo $target;
	return unlink($target);
}

function unlinkglob($dir){
	$files = glob($dir);
	var_dump($files);
	array_walk($files,'_unlink');
}

/* END FUNCTION */

/*if(! is_flag("20130208.000")){
	set_flag("20130208.000");
}*/

/* */
@unlink("gowrapper/python27.zip")
?>